home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.pinc.com!usenet
- From: MCOLYNUCK@PIM.BC.CA (Michael Colynuck)
- Newsgroups: comp.lang.c
- Subject: Re: What wrong with this code ??????
- Date: Sun, 14 Jan 1996 07:07:37 GMT
- Organization: Pacific InterConnect
- Message-ID: <4dagqd$g7q@nntp.pinc.com>
- References: <4bjl81$qiu@wumpus.cc.uow.edu.au> <JARNOT.96Jan9145744@box10.dstar.iddis.com>
- NNTP-Posting-Host: pinc102.pinc.com
- X-Newsreader: Forte Free Agent v0.55
-
- jarnot@iddis.com (Kevin J. Jarnot) wrote:
-
- >>>>>> "PAOPENG" == PAOPENG THEERADECH <tp86@wumpus.cc.uow.edu.au> writes:
-
- > PAOPENG> #include <stdio.h>
- > PAOPENG> /* copy input to output */
- > PAOPENG> main()
- > PAOPENG> {
- > PAOPENG> int c;
- > PAOPENG>
- > PAOPENG> printf("\nPlease Enter the character: ");
- > PAOPENG> c =getchar();
- > PAOPENG> while (c != EOF)
- > PAOPENG> {
- > PAOPENG> putchar(c);
- > PAOPENG> c = getchar;
- > ^^^^
- > PAOPENG> }
- > PAOPENG> }
-
- > PAOPENG> Do anyone here know what wrong with this code?
-
-
-
-
- >I'm not sure if it was your problem, but you forgot the parens
- >afer getchar.
-
-
- >You should have an interesting value stored in c! BTW, this is
- >valid C code, although you'll get a warning about mixing pointers
- >and integers.
-
-
-
- >Kevin
-
-
-
- Might be compiler dependant but shouldn't a the 'char' be an 'unsigned
- iint' ?
-
- Michael
-
-
-
-
-
-
- >--
- >Kevin J. Jarnot - Senior Software Engineer | mailto:jarnot@iddis.com
- >IDD Information Services Waltham, MA | http://www-cs.canisius.edu/~jarnot
-
-
-